package com.ls.user.pojo.client;

import com.ls.common.entity.Result;
import com.ls.user.pojo.entity.User;
import com.ls.user.pojo.entity.UserScore;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Description
 * @Author konglz
 * @Data 2023/5/3 16:11
 */
@FeignClient(name = "ls-user", path = "/user")
public interface UserFeignClient {

    @GetMapping("/getUserInfo/{id}")
    @ApiOperation("获取用户信息")
    public Result<User> getUserInfo(@PathVariable Integer id);

    @PostMapping("/addOrUpdateUserScore")
    @ApiOperation("添加或者修改用户积分")
    public Result<Boolean> addOrUpdateUserScore(@RequestBody UserScore userScore);

    @GetMapping("/getScoreByUserId/{userId}")
    @ApiOperation("根据用户id查询用户积分")
    public Result<UserScore> getScoreByUserId(@PathVariable Integer userId);
}
